package main

import (
	"bufio"
	"fmt"
	"net/http"
	"time"
)


var client = &http.Client{
	Transport: &http.Transport{},
}

func Call(){
	resp, err := client.Get("http://127.0.0.1:8888")
	if err != nil {
		// handle error
		fmt.Println("1111", err)
		return
	}
	defer resp.Body.Close()
	reader := bufio.NewReader(resp.Body)
	for {
		line, _, _ := reader.ReadLine()  //ReadLine()默认会以\n为分隔符来分次获取数据
		fmt.Println(string(line))
                if (string(line) == ""){
			break
		}
	}


}

func main(){

	Call()
	time.Sleep(1 * time.Second)

}
